<?php

$blog = $vars['entity'];

?>

<div class="elgg-river-responses">
<?php
$options = array(
	'guid' => $blog->getGUID(),
	'annotation_name' => 'generic_comment',
	'limit' => 3,
	'order_by' => 'n_table.time_created desc'
);
$comments = elgg_get_annotations($options);
foreach ($comments as $comment) {
$comment->value = elgg_get_excerpt($comment->value);
}
//print_r($comments);
if ($comments) {
	// why is this reversing it? because we're asking for the 3 latest
	// comments by sorting desc and limiting by 3, but we want to display
	// these comments with the latest at the bottom.
	$comments = array_reverse($comments);
?>

	<span class="elgg-river-comments-tab"><?php echo elgg_echo('comments'); ?></span>

<?php

	echo elgg_view_annotation_list($comments, array('list_class' => 'elgg-river-comments'));
}

// inline comment form
$form_vars = array('id' => "comments-add-{$blog->getGUID()}", 'class' => 'hidden');
$body_vars = array('entity' => $blog, 'inline' => true);
echo elgg_view_form('comments/add', $form_vars, $body_vars);

?>
</div>
